package com.bbzn.user.client.service;

import com.bbzn.user.client.utils.PageInfo;
import com.bbzn.user.client.vo.req.RangeEntity;

import java.util.List;
import java.util.Map;

/**
 * @Author wulongbo
 * @Date 2022/1/19 15:28
 * @Version 1.0
 */
public interface SimpleMongoService<T> {

    void createCollection(String name);

    String createIndex(String collectionName, String filedName);

    List<String> getAllIndexes(String collectionName);

    void insert(T info, String collectionName);

    void insertMulti(List<T> infos, String collectionName);

    void updateById(String id, String collectionName, T info);

    void deleteById(String id, Class<T> clazz, String collectionName);

    T selectById(String id, Class<T> clazz, String collectionName);

    List<T> selectList(String collectName, Class<T> clazz);

    List<T> selectList(String collectName, Class<T> clazz, Integer currentPage, Integer pageSize);

    List<T> selectByCondition(String collectName, Map<String, Object> conditions, Class<T> clazz, Integer currentPage, Integer pageSize);

    Long selectCountByCondition(String collectName, Map<String, RangeEntity> range, Map<String, Object> conditions, Map<String, List<String>> inList);

    PageInfo<T> selectPageByCondition(String collectName, Map<String, RangeEntity> range, Map<String, Object> conditions, Map<String, List<String>> inList, Class<T> clazz, Integer currentPage, Integer pageSize);

    List<T> selectByCondition(String collectName, Map<String, RangeEntity> range, Map<String, Object> conditions, Map<String, List<String>> inList, Class<T> clazz, Integer currentPage, Integer pageSize);

}
